Integrand size = 12, antiderivative size = 128 \[ \int x^2 \tan ^3(a+b x) \, dx=\frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {\operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b} \]
[Out]
Time = 0.22 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3801, 3556, 30, 3800, 2221, 2611, 2320, 6724} \[ \int x^2 \tan ^3(a+b x) \, dx=\frac {\operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {x^2}{2 b}-\frac {i x^3}{3} \]
[In]
[Out]
Rule 30
Rule 2221
Rule 2320
Rule 2611
Rule 3556
Rule 3800
Rule 3801
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \frac {x^2 \tan ^2(a+b x)}{2 b}-\frac {\int x \tan ^2(a+b x) \, dx}{b}-\int x^2 \tan (a+b x) \, dx \\ & = -\frac {i x^3}{3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}+2 i \int \frac {e^{2 i (a+b x)} x^2}{1+e^{2 i (a+b x)}} \, dx+\frac {\int \tan (a+b x) \, dx}{b^2}+\frac {\int x \, dx}{b} \\ & = \frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}-\frac {2 \int x \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = \frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {i \int \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right ) \, dx}{b^2} \\ & = \frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b}+\frac {\text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^3} \\ & = \frac {x^2}{2 b}-\frac {i x^3}{3}+\frac {x^2 \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac {\log (\cos (a+b x))}{b^3}-\frac {i x \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}+\frac {\operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {x \tan (a+b x)}{b^2}+\frac {x^2 \tan ^2(a+b x)}{2 b} \\ \end{align*}
Time = 2.28 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.34 \[ \int x^2 \tan ^3(a+b x) \, dx=\frac {e^{-i a} \left (2 b^2 x^2 \left (2 i b x+3 \left (1+e^{2 i a}\right ) \log \left (1+e^{-2 i (a+b x)}\right )\right )+6 i b \left (1+e^{2 i a}\right ) x \operatorname {PolyLog}\left (2,-e^{-2 i (a+b x)}\right )+3 \left (1+e^{2 i a}\right ) \operatorname {PolyLog}\left (3,-e^{-2 i (a+b x)}\right )\right ) \sec (a)+6 b^2 x^2 \sec ^2(a+b x)-12 b x \sec (a) \sec (a+b x) \sin (b x)-4 b^3 x^3 \tan (a)-12 (\log (\cos (a+b x))+b x \tan (a))}{12 b^3} \]
[In]
[Out]
Time = 0.30 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.41
method | result | size |
risch | \(-\frac {i x^{3}}{3}+\frac {2 x \left (b x \,{\mathrm e}^{2 i \left (b x +a \right )}-i {\mathrm e}^{2 i \left (b x +a \right )}-i\right )}{b^{2} \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )^{2}}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {4 i a^{3}}{3 b^{3}}+\frac {2 i a^{2} x}{b^{2}}+\frac {x^{2} \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b}-\frac {i x \,\operatorname {Li}_{2}\left (-{\mathrm e}^{2 i \left (b x +a \right )}\right )}{b^{2}}+\frac {\operatorname {Li}_{3}\left (-{\mathrm e}^{2 i \left (b x +a \right )}\right )}{2 b^{3}}-\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b^{3}}+\frac {2 \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}\) | \(180\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 240 vs. \(2 (109) = 218\).
Time = 0.26 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.88 \[ \int x^2 \tan ^3(a+b x) \, dx=\frac {2 \, b^{2} x^{2} \tan \left (b x + a\right )^{2} + 2 \, b^{2} x^{2} + 2 i \, b x {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - 2 i \, b x {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - 4 \, b x \tan \left (b x + a\right ) + 2 \, {\left (b^{2} x^{2} - 1\right )} \log \left (-\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, {\left (b^{2} x^{2} - 1\right )} \log \left (-\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + {\rm polylog}\left (3, \frac {\tan \left (b x + a\right )^{2} + 2 i \, \tan \left (b x + a\right ) - 1}{\tan \left (b x + a\right )^{2} + 1}\right ) + {\rm polylog}\left (3, \frac {\tan \left (b x + a\right )^{2} - 2 i \, \tan \left (b x + a\right ) - 1}{\tan \left (b x + a\right )^{2} + 1}\right )}{4 \, b^{3}} \]
[In]
[Out]
\[ \int x^2 \tan ^3(a+b x) \, dx=\int x^{2} \tan ^{3}{\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 736 vs. \(2 (109) = 218\).
Time = 0.66 (sec) , antiderivative size = 736, normalized size of antiderivative = 5.75 \[ \int x^2 \tan ^3(a+b x) \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int x^2 \tan ^3(a+b x) \, dx=\int { x^{2} \tan \left (b x + a\right )^{3} \,d x } \]
[In]
[Out]
Timed out. \[ \int x^2 \tan ^3(a+b x) \, dx=\int x^2\,{\mathrm {tan}\left (a+b\,x\right )}^3 \,d x \]
[In]
[Out]